﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web.Mvc;

namespace LandPortMoblieWeb.Filter {

    public static class HtmlHepl {

        public static string PanHanZI(this HtmlHelper helper, string cc) {
            var reg = "/[\u4E00-\u9FA5]/g";

            Regex r = new Regex(@"[\u4e00-\u9fa5]+");

            Match mc = r.Match(cc);

            if (mc.Length != 0) {
                return cc;
               

            } else {

                return DateTime.Parse(cc).ToString("yyyy-MM-dd");
            }

        }

        public static string PanDateTime(this HtmlHelper helper, string cc) {

            if (!string.IsNullOrEmpty(cc)) {
                var Frist = cc.Substring(0, 1);
                if (Frist == "0") {
                    return "";
                } else { return cc; }
            } else {

                return "";
            }     
      
        }
    }
}